<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .app{
            width: 600px;
            height: 600px;
            background: pink;
            margin: 0 auto;
        }
        .app > div{
            height: 80px;
            border: 1px solid #000;
        }
        .app > button{
            width: 66px;
            height: 66px;
            display: block;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <div class="app">
        <prent v-model:modelValue="username"></prent>
    </div>
    <!-- 父组件 -->
    <template id="prent">
            <input type="text" :value="modelValue">
            <button @click="$emit('update:modelValue','xxx')">数据传送</button>
    </template>
</body>
</html>
<script>
    const app = Vue.createApp({
        data(){
            return{
                username:'ming'
            }
        },
        components:{
            prent:{
                template:'#prent',
                porps:{
                    modelValue:{type:String}
                }
            }
        }
    })
    app.mount('.app')
</script>